package com.gitee.ykr.lightweight.rpc.common.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author YKR
 * @Describe
 * @date 2021/8/8
 */
@NoArgsConstructor
@Data
public class NettyRpcResponse<T> extends NettyRpcMessage implements Serializable {

    //对应的请求id
    private static final long serialVersionUID = 6395330487058794296L;

    //响应码
    private int code;

    //返回信息
    private String msg;

    //返回结果
    private T result;

    //同步标记
    private boolean isSyn;

    public NettyRpcResponse(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public NettyRpcResponse(int code, String msg, T result) {
        this.code = code;
        this.msg = msg;
        this.result = result;
    }
}
